package redis

import (
	"fmt"
	"github.com/redis/go-redis/v9"
	"life/config"
	"life/global"
	"log"
)

func InitRedis() {
	re := config.AppConf.RedisConfig
	dsn := fmt.Sprintf("%s:%d", re.Host, re.Port)
	global.Client = redis.NewClient(&redis.Options{
		Addr:     dsn,
		Password: "", // no password set
		DB:       0,  // use default DB
	})
	log.Println("redis link success")

}
